//
//  Method.swift
//  SwiftDemo
//
//  Created by lizq on 16/7/5.
//  Copyright © 2016年 lizq. All rights reserved.
//

import UIKit

struct Vector {
    var x = 0.0, y = 0.0
     mutating func moveByX(_ deltaX:Double, deltaY: Double) {
        x += deltaX
        y += deltaY
    }
}

class Method: NSObject {
    var count = 0
    
    func action() {
        increment()
        incrementBy(10)
        reset()
        add(10, 10)
        
        var someVector = Vector(x: 10, y: 10)
        someVector.moveByX(20, deltaY: 20)
    }
    
    func increment() {
        count += 1
    }
    func incrementBy(_ amount: Int) {
        count += amount
    }
    func reset() {
        count = 0
    }
    func add(_ value1:Int,_ value2:Int) {
        print("nil value")
        count += value1 + value2
    }
}
